//
// Created by Jisam on 06/10/2024 13:01.
// Solution of  a
#include <bits/stdc++.h>

#define  int long long
#define  endl "\n"
using namespace std;


signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) cin >> a[i];
        sort(a.begin(),a.end());
        int t = a[0];
        for (int i = 0; i < n; i++) {
            t = floor((a[i] + t) / 2);

        }
        cout << t <<endl;
    }

    return 0;
}